package com.qingxin.sys.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * 系统日志表
 * SysLog entity. 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_log")
public class SysLog extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {

	// Fields
	private static final long serialVersionUID = -7265648110520864600L;
	private String logid;
	private String loginName;
	private String username;
	private Date logtime;
	private Integer logtype;//日志类型：1登录日志、2注销日志、3业务日志
	private String loginfo;
	private String tableName;
	private String ip;
	private Long timemark;

	// Constructors

	/** default constructor */
	public SysLog() {
	}

	/** minimal constructor */
	public SysLog(Long timemark) {
		this.timemark = timemark;
	}

	/** full constructor */
	public SysLog(String loginName, String username, Date logtime,
			Integer logtype, String loginfo, String tableName, String ip, Long timemark) {
		this.loginName = loginName;
		this.username = username;
		this.logtime = logtime;
		this.logtype = logtype;
		this.loginfo = loginfo;
		this.tableName = tableName;
		this.ip = ip;
		this.timemark = timemark;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "logid", unique = true, nullable = false, length = 32)
	public String getLogid() {
		return this.logid;
	}

	public void setLogid(String logid) {
		this.logid = logid;
	}

	@Column(name = "login_name", length = 20)
	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Column(name = "username", length = 20)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "logtime", length = 23)
	public Date getLogtime() {
		return this.logtime;
	}

	public void setLogtime(Date logtime) {
		this.logtime = logtime;
	}

	@Column(name = "logtype")
	public Integer getLogtype() {
		return this.logtype;
	}

	public void setLogtype(Integer logtype) {
		this.logtype = logtype;
	}

	@Column(name = "loginfo", length = 4000)
	public String getLoginfo() {
		return this.loginfo;
	}

	public void setLoginfo(String loginfo) {
		this.loginfo = loginfo;
	}

	@Column(name = "tableName", length = 50)
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@Column(name = "ip", length = 50)
	public String getIp() {
		return this.ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name = "timemark", nullable = false)
	@Transient
	public Long getTimemark() {
		return this.timemark;
	}

	public void setTimemark(Long timemark) {
		this.timemark = timemark;
	}

}